/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sda.levelup.annotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author user
 */
public class Main
{
    public static void main(String[] args)
    {
        Class<MyClass> clc = MyClass.class;
        Method[] methods = clc.getDeclaredMethods();
        List<Method> list = new LinkedList<Method>();
        for(int i = 0; i<methods.length; i++){
           if(methods[i].getAnnotation(MyAnnotation.class)!=null){
               methods[i].setAccessible(true);
               list.add(methods[i]);
           }
        }
        for (Method m : list){
            System.out.println(m.getName());
        }
    }
}
